import App from './App'


import Vue from 'vue'
import './uni.promisify.adaptor'
Vue.config.productionTip = false
import store from './store'

import config from '@/config' // 配置

import mixin from "./utils/mixin.js"
Vue.use(mixin)

import uView from '@/uni_modules/uview-ui'
Vue.use(uView)
 

App.mpType = 'app'
const app = new Vue({
	store,
	...App
})

// Vue.prototype.$http = http
Vue.prototype.$go = function(path) {
	// uni.navigateBack({
	// 	delta: 1
	// });
	console.log(path);
	uni.navigateTo({
		url: path
	})
}
Vue.prototype.$back = function(path) {console.log(path);
	uni.navigateBack({
		delta: 1
	});
}

Vue.prototype.$showFill = function(value, show=true) {
	if(!show) {
		return;
	}
	uni.showModal({
		title: '查看',
		content: value,
		showCancel: false,
		success: (res) => {
			if (res.confirm) {
				console.log('用户点击确定');
	
			} else if (res.cancel) {
				console.log('用户点击取消');
			}
		}
	});
	
}

Vue.prototype.$ReserveOne = function(value, num=1) {
	if(!value) return value;
	if(num < 1) return value;
	try{
		return Number(value).toFixed(num)
	}catch(e){
		//TODO 不是正常文本
		return value
	}
	
}

app.$mount()